#ifndef FFPROTOCOL_H
#define FFPROTOCOL_H

struct RecvBuf {
	unsigned long		addr;
	unsigned short		portno;
	int					addrSize;
	int					size;
	char				msgBuf[MAX_UDPBUF];
};

struct MsgBuf
{
	unsigned long	addr;
	char	userName[MAX_NAMEBUF];
	char	hostName[MAX_NAMEBUF];
	char	nickname[MAX_NAMEBUF];
	int		version;
	int		portNo;
	unsigned long	packetNo;
	unsigned long	command;
	int		exOffset;		
	int		dummy;
	char	msgBuf[MAX_UDPBUF];
};

class Protocol
{
public:
	virtual int  FFInit() = 0;
	virtual long FFMakeMsg(char *buf, unsigned long command, const char *msg, const char *exMsg, int *packet_len) = 0;
	virtual bool FFResolvMsg(struct RecvBuf *buf,struct MsgBuf *msg) = 0;
	virtual void FFLogin() = 0;
	virtual int FFUdpSend(unsigned long addr, unsigned long command, char *msgbuf, char *exmsgbuf) = 0;
	virtual void FFUdpBroadSend() = 0;
	virtual void FFTcpSend() = 0;
	virtual bool FFUDPRecv(struct MsgBuf *msg) = 0;
	virtual void FFRegisterEvent(void (*p)(void *)) = 0;	
	virtual void FFClose() = 0;
	virtual void FFUserNotice(void (*p)(void *,void *),void*) = 0;
};

#endif